import request from "@/api/request.js";

// 手机号登录
export const reqLogin = (phone,password) =>{
    return request({
        url:'/login/cellphone',
        params:{
            phone,
            password
        }
    })
}
// 获取二维码 key 
export const reqGetKey  = () =>{
    return request({
        url:'/login/qr/key',
        params:{
            timestamp:Date.parse(new Date())
        }
    })
}
// 获取二维码
export const reqGetQrCode = (key) =>{
    return request({
        url:'/login/qr/create',
        params:{
            key,
            timestamp:Date.parse(new Date()),
            qrimg:true
        }
    })
}
// 检查二维码是否有效
export const reqCheckKey = (key) =>{
    return request({
        url:'/login/qr/check',
        params:{
            key,
            timestamp:Date.parse(new Date())
        }
    })
}
// 获取账户信息
export const reqUserAccount = () =>{
    return request({
        url:'/user/account',
        timestamp:Date.parse(new Date())
    })
}
// 获取用户的详情
export const reqUserInfo = (uid) =>{
    return request({
        url:'/user/detail',
        params:{
            uid,
            timestamp:Date.parse(new Date())
        }
    })
}
// 退出登录
export const reqLogout = ()=>{
    return request({
        url:'/logout'
    })
}
